package com.example.cgpsys.beans;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("product")
public class Product {

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String name;

    private Integer number;

    private Double price;

    private String picture;

    private Double groupPrice;

    /**
     * 当前拼团人数
     */
    @TableField(exist = false)
    private Integer peoples;

    /**
     * 商品介绍
     */
    private String intro;

    /**
     * 拼团人数显示
     */
    private Integer groupNum;

    /**
     * 单人购买限制
     */
    private Integer limitNum;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date updateTime;
}
